package com.hzhjhh.view.manageView.menus.purchase.purchaseOrder;

import java.util.Vector;

import javax.swing.JButton;

import com.hzhjhh.init.dialog.Mytable;
import com.hzhjhh.view.manageView.menus.purchase.PurchaseOrderDialog;
import com.hzhjhh.view.manageView.menus.purchase.constant.ShowConstants;

/**
 * 菜单栏初始化-采购-采购表弹出框-全部清空按钮
 * 
 * @author 12083
 *
 */
public class ClearAllBt {

	/**
	 * 按钮
	 */
	public static JButton btInit(PurchaseOrderDialog stockDialog) {
		JButton clearAll = new JButton();
		clearAll.setBounds(457, 93, 83, 25);
        clearAll.setText("全部清空");
        clearAll.addActionListener(event -> {
        	stockDialog.getInserAll().removeAllElements(); //清空结果集
//            jTable1 = Mytable.maketable(new Vector<>(), ShowConstants.HEAD_NAME); //显示内容
            stockDialog.getJScrollPane1().getViewport()
            	.add(Mytable.maketable(new Vector<>(), ShowConstants.PURCHASE_HEAD_NAME)); //把表装入容器
        });
        
		return clearAll;
	}
}
